package com.ex.shapecalc;

import com.ex.question.base.ShapeQuestion;

public class SquareQuestion extends ShapeQuestion {
	int mLength;

	public SquareQuestion() {
		mQuestionTypeName = "正方形面积计算";
		createQuestion();
	}

	public SquareQuestion(int l) {
		mQuestionTypeName = "正方形面积计算";
		createQuestion(l);
	}

	public void CalcArea() {
		mArea = mLength * mLength;
	}

	public void CalcPerimeter() {
		this.mPerimeter = 4 * mLength;
	}

	public void createQuestion() {
		createQuestion(mRand.getRandom10());
	}

	public void createQuestion(int l) {
		mLength = l; 
		CalcArea();
		CalcPerimeter();
	}
}
